<template>
  <div class="flex-col page">
    <div class="flex-col section">
      <div class="flex-col section_2">
        <div class="flex-row justify-between relative">
          <van-icon @click="goBack" name="arrow-left" size="16px" />
          <span>我要求购</span>
          <span></span>
        </div>
        <div class="mt-22 flex-col items-start relative group">
          <span class="font text">我要</span>
          <div class="flex-col justify-start group_2 pos">
            <div class="flex-row items-center section_3">
              <div>
                <img class="image_4" src="https://shops.cg500.com/static/newimg/17108379734709004532.png" />
              </div>
              <span class="ml-6 text_4">我的购物积分</span>
              <span class="ml-6 text_3">{{ list.jifen }}</span>
            </div>
            <img class="image_2 pos_2" src="https://shops.cg500.com/static/newimg/17108379734634431784.png" />
            <span class="font text_2 pos_3">求购</span>
          </div>
        </div>
      </div>
      <div class="flex-col section_4">
        <span class="self-start font_2 text_5">求购诺丽果数量</span>
        <div class="flex-col self-stretch mt-17-5">
          <input class="input section_5" v-model="num" @click="changeValue" />
          <div class="flex-row input_2 section_6 mt-9-5">
            <div>
              <img class="self-center image_4" src="https://shops.cg500.com/static/newimg/17108379734817308940.png" />
            </div>
            <span class="self-center font_3 text_6">当前价值{{ list.jiazhi }}</span>
           
          </div>
        </div>
      </div>
    </div>
    <div class="flex-col justify-start items-center button text-wrapper mt-337">
      <span class="font_2 text_8" @click="submit()">确认</span>
    </div>
  </div>
</template>
<script>
import { Toast } from "vant";
export default {
  components: {},
  props: {},
  data() {
    return {
      num: "",
      list: {}
    };
  },
  mounted() {
    this.getData();
  },
  methods: {
    // 返回上一页
    goBack() {
      this.$router.go(-1);
    },
    changeValue: function(e) {
      this.num = e.target.value;
      console.log(this.num, "1111111111111");
    },
    getData() {
      $http
        .get(
          "Nuoli.my_nuoli",
          {
            uid: localStorage.getItem("uid")
          },
          "..."
        )
        .then(res => {
          this.list = res.data;
          console.log(res.data, "走了吗走了吗走了吗走了吗走了吗");
        });
    },
    submit() {
      console.log(this.num, "1111111111111");
      $http
        .get(
          "Nuoli.qiugou",
          {
            uid: localStorage.getItem("uid"),
            num: this.num
          },
          "..."
        )
        .then(res => {
          if(res.data == '1') {
            this.$toast("求购成功");
            this.num='';
            setTimeout(()=>{
              this.$router.go(-1);
            },1500);
          }
          if (res.result !== 1) {
            Toast(res.msg);
            return;
          }
          console.log(res,"zpoaihdsuiwegtfaewrjbks,d");
        });
    }
  }
};
</script>
<style scoped>
/************************************************************
** 请将全局样式拷贝到项目的全局 CSS 文件或者当前页面的顶部 **
** 否则页面将无法正常显示                                  **
************************************************************/

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Microsoft Yahei", sans-serif;
}

body * {
  box-sizing: border-box;
  flex-shrink: 0;
}

#app {
  width: 100vw;
  height: 100vh;
}

.ipt {
  border: none;
  border-bottom: 1px solid #494a92;
  margin-left: 10px;
  width: 100px;
}

.flex-row {
  display: flex;
  flex-direction: row;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.justify-evenly {
  justify-content: space-evenly;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.items-center {
  align-items: center;
}

.items-baseline {
  align-items: baseline;
}

.items-stretch {
  align-items: stretch;
}

.self-start {
  align-self: flex-start;
}

.self-end {
  align-self: flex-end;
}

.self-center {
  align-self: center;
}

.self-baseline {
  align-self: baseline;
}

.self-stretch {
  align-self: stretch;
}

.flex-1 {
  flex: 1 1 0%;
}

.flex-auto {
  flex: 1 1 auto;
}

.grow {
  flex-grow: 1;
}

.grow-0 {
  flex-grow: 0;
}

.shrink {
  flex-shrink: 1;
}

.shrink-0 {
  flex-shrink: 0;
}

.relative {
  position: relative;
}

.ml-2 {
  margin-left: 0.13rem;
}

.mt-2 {
  margin-top: 0.13rem;
}

.ml-4 {
  margin-left: 0.25rem;
}

.mt-4 {
  margin-top: 0.25rem;
}

.ml-6 {
  margin-left: 0.38rem;
}

.mt-6 {
  margin-top: 0.38rem;
}

.ml-8 {
  margin-left: 0.5rem;
}

.mt-8 {
  margin-top: 0.5rem;
}

.ml-10 {
  margin-left: 0.63rem;
}

.mt-10 {
  margin-top: 0.63rem;
}

.ml-12 {
  margin-left: 0.75rem;
}

.mt-12 {
  margin-top: 0.75rem;
}

.ml-14 {
  margin-left: 0.88rem;
}

.mt-14 {
  margin-top: 0.88rem;
}

.ml-16 {
  margin-left: 1rem;
}

.mt-16 {
  margin-top: 1rem;
}

.ml-18 {
  margin-left: 1.13rem;
}

.mt-18 {
  margin-top: 1.13rem;
}

.ml-20 {
  margin-left: 1.25rem;
}

.mt-20 {
  margin-top: 1.25rem;
}

.ml-22 {
  margin-left: 1.38rem;
}

.mt-22 {
  margin-top: 1.38rem;
}

.ml-24 {
  margin-left: 1.5rem;
}

.mt-24 {
  margin-top: 1.5rem;
}

.ml-26 {
  margin-left: 1.63rem;
}

.mt-26 {
  margin-top: 1.63rem;
}

.ml-28 {
  margin-left: 1.75rem;
}

.mt-28 {
  margin-top: 1.75rem;
}

.ml-30 {
  margin-left: 1.88rem;
}

.mt-30 {
  margin-top: 1.88rem;
}

.ml-32 {
  margin-left: 2rem;
}

.mt-32 {
  margin-top: 2rem;
}

.ml-34 {
  margin-left: 2.13rem;
}

.mt-34 {
  margin-top: 2.13rem;
}

.ml-36 {
  margin-left: 2.25rem;
}

.mt-36 {
  margin-top: 2.25rem;
}

.ml-38 {
  margin-left: 2.38rem;
}

.mt-38 {
  margin-top: 2.38rem;
}

.ml-40 {
  margin-left: 2.5rem;
}

.mt-40 {
  margin-top: 2.5rem;
}

.ml-42 {
  margin-left: 2.63rem;
}

.mt-42 {
  margin-top: 2.63rem;
}

.ml-44 {
  margin-left: 2.75rem;
}

.mt-44 {
  margin-top: 2.75rem;
}

.ml-46 {
  margin-left: 2.88rem;
}

.mt-46 {
  margin-top: 2.88rem;
}

.ml-48 {
  margin-left: 3rem;
}

.mt-48 {
  margin-top: 3rem;
}

.ml-50 {
  margin-left: 3.13rem;
}

.mt-50 {
  margin-top: 3.13rem;
}

.ml-52 {
  margin-left: 3.25rem;
}

.mt-52 {
  margin-top: 3.25rem;
}

.ml-54 {
  margin-left: 3.38rem;
}

.mt-54 {
  margin-top: 3.38rem;
}

.ml-56 {
  margin-left: 3.5rem;
}

.mt-56 {
  margin-top: 3.5rem;
}

.ml-58 {
  margin-left: 3.63rem;
}

.mt-58 {
  margin-top: 3.63rem;
}

.ml-60 {
  margin-left: 3.75rem;
}

.mt-60 {
  margin-top: 3.75rem;
}

.ml-62 {
  margin-left: 3.88rem;
}

.mt-62 {
  margin-top: 3.88rem;
}

.ml-64 {
  margin-left: 4rem;
}

.mt-64 {
  margin-top: 4rem;
}

.ml-66 {
  margin-left: 4.13rem;
}

.mt-66 {
  margin-top: 4.13rem;
}

.ml-68 {
  margin-left: 4.25rem;
}

.mt-68 {
  margin-top: 4.25rem;
}

.ml-70 {
  margin-left: 4.38rem;
}

.mt-70 {
  margin-top: 4.38rem;
}

.ml-72 {
  margin-left: 4.5rem;
}

.mt-72 {
  margin-top: 4.5rem;
}

.ml-74 {
  margin-left: 4.63rem;
}

.mt-74 {
  margin-top: 4.63rem;
}

.ml-76 {
  margin-left: 4.75rem;
}

.mt-76 {
  margin-top: 4.75rem;
}

.ml-78 {
  margin-left: 4.88rem;
}

.mt-78 {
  margin-top: 4.88rem;
}

.ml-80 {
  margin-left: 5rem;
}

.mt-80 {
  margin-top: 5rem;
}

.ml-82 {
  margin-left: 5.13rem;
}

.mt-82 {
  margin-top: 5.13rem;
}

.ml-84 {
  margin-left: 5.25rem;
}

.mt-84 {
  margin-top: 5.25rem;
}

.ml-86 {
  margin-left: 5.38rem;
}

.mt-86 {
  margin-top: 5.38rem;
}

.ml-88 {
  margin-left: 5.5rem;
}

.mt-88 {
  margin-top: 5.5rem;
}

.ml-90 {
  margin-left: 5.63rem;
}

.mt-90 {
  margin-top: 5.63rem;
}

.ml-92 {
  margin-left: 5.75rem;
}

.mt-92 {
  margin-top: 5.75rem;
}

.ml-94 {
  margin-left: 5.88rem;
}

.mt-94 {
  margin-top: 5.88rem;
}

.ml-96 {
  margin-left: 6rem;
}

.mt-96 {
  margin-top: 6rem;
}

.ml-98 {
  margin-left: 6.13rem;
}

.mt-98 {
  margin-top: 6.13rem;
}

.ml-100 {
  margin-left: 6.25rem;
}

.mt-100 {
  margin-top: 6.25rem;
}

.mt-17-5 {
  margin-top: 1.09rem;
}

.mt-9-5 {
  margin-top: 0.59rem;
}

.mt-337 {
  margin-top: 21.06rem;
}

.page {
  padding-bottom: 2rem;
  background-color: #fafafa;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
}

.section {
  padding-bottom: 0.5rem;
  background-image: linear-gradient(0deg, #fafafa 0%, #fcf6e7 100%);
  border-radius: 0.13rem;
}

.section_2 {
  padding: 1.03rem 0.63rem 0.88rem;
  background-image: url("https://shops.cg500.com/static/newimg/17108379734562541404.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.image {
  margin-left: 1.25rem;
  margin-right: 0.47rem;
  width: 20.47rem;
  height: 0.75rem;
}

.group {
  padding: 0.16rem 0 4.5rem;
}

.image_3 {
  width: 0.63rem;
  height: 1.09rem;
}

.font {
  font-size: 2.25rem;
  font-family: Alimama ShuHeiTi;
  line-height: 2.25rem;
  font-weight: 700;
}

.text {
  margin-left: 6.22rem;
  margin-top: 1.44rem;
  color: #050403;
  text-shadow: 0.04rem 0.085rem #d8c9ba;
}

.group_2 {
  padding-top: 5.94rem;
}

.pos {
  position: absolute;
  left: 0.28rem;
  right: 0.34rem;
  top: 0;
}

.section_3 {
  padding: 0.78rem 3.53rem 0.63rem;
  background-color: #fffdf7;
  border-radius: 0.25rem;
}

.image_4 {
  width: 1.06rem;
  height: 1.06rem;
}

.text_4 {
  color: #151515;
  font-size: 1rem;
  font-family: PingFang SC;
  line-height: 0.97rem;
}

.text_3 {
  color: #151515;
  font-size: 1.25rem;
  font-family: PingFang SC;
  font-weight: 500;
  line-height: 0.94rem;
}

.image_2 {
  width: 7.66rem;
  height: 6.5rem;
}

.pos_2 {
  position: absolute;
  right: 0.81rem;
  top: 0;
}

.text_2 {
  color: #f6cd58;
  text-shadow: 0.04rem 0.085rem #ffe8a6;
}

.pos_3 {
  position: absolute;
  right: 6.5rem;
  top: 1.69rem;
}

.section_4 {
  margin: 0 0.94rem;
  padding: 1.38rem 1.28rem 2.13rem;
  background-color: #ffffff;
  border-radius: 0.63rem;
}

.font_2 {
  font-size: 1rem;
  font-family: PingFang SC;
  line-height: 0.97rem;
  font-weight: 500;
}

.text_5 {
  color: #151515;
}

.input {
  margin-right: 0.16rem;
}

.section_5 {
  background-color: #ffffff;
  border-radius: 0.25rem;
  height: 2.81rem;
  border-left: solid 0.031rem #dddddd;
  border-right: solid 0.031rem #dddddd;
  border-top: solid 0.031rem #dddddd;
  border-bottom: solid 0.031rem #dddddd;
  padding-left: 0.7rem;
}

.input_2 {
  margin-right: 0.25rem;
}

.section_6 {
  padding: 1.19rem 1.16rem 0.72rem;
  background-image: url("https://shops.cg500.com/static/newimg/17108386183211432244.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.font_3 {
  font-size: 0.88rem;
  font-family: PingFang SC;
  line-height: 0.84rem;
  font-weight: 500;
  color: #494a92;
}

.text_6 {
  margin-left: 0.44rem;
}

.text_7 {
  margin-left: 0.16rem;
  margin-top: 0.84rem;
}

.button {
  margin: 0 0.94rem;
}

.text-wrapper {
  padding: 0.88rem 0;
  background-color: #f6ce54;
  border-radius: 1.38rem;
}

.text_8 {
  color: #111111;
}
</style>
